
import LogAPI from '../api/log.js';

export const Log={
   state:{
      loglist:[],
      log_total_count:0,
   },
   mutations:{
      setLogList(state,list){
          state.loglist=list;
      },
      setLogTotalCount(state,total_count){
          state.log_total_count=total_count;
      }
   },
   actions:{
      loadLogList(context,data){
          LogAPI.getLogList(data).then(function(response){
              if(response.data.code==1){
                  context.commit('setLogList',response.data.list);
                  context.commit('setLogTotalCount',response.data.total_count);
              }
          })
      }
   },
   getters:{
      getLogList:state =>{
         return state.loglist
      },
      getLogTotalCount: state =>{
         return state.log_total_count
      }
   }
}
